package com.tinem.platform.module.starter.jpa.entity.oauth;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className Oauth2WechatOpenUserInfo
 * @description 微信公众平台用户信息
 * @site
 * @company
 * @create 2021-10-29
 */
@Data
@Entity
@ToString
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name="t_oauth2_wechat_open_user_info")
@ApiModel("微信公众平台用户信息")
public class Oauth2WechatOpenUserInfo implements Serializable,Cloneable{
    @Id
    @Column(name = "c_id",nullable=true)
    @ApiModelProperty(name = "id", value = "编号",required = true)
    private String id;

    @Column(name = "c_user_id",nullable=true)
    @ApiModelProperty(name = "userId", value = "用户id",required = true)
    private String userId;

    @Column(name = "c_openid",nullable=true)
    @ApiModelProperty(name = "openid", value = "普通用户的标识，对当前开发者帐号唯一",required = true)
    private String openid;

    @Column(name = "c_nickname",nullable=false)
    @ApiModelProperty(name = "nickname", value = "普通用户昵称",required = false)
    private String nickname;

    @Column(name = "c_language",nullable=false)
    @ApiModelProperty(name = "language", value = "语言",required = false)
    private String language;

    @Column(name = "c_sex",nullable=false)
    @ApiModelProperty(name = "sex", value = "普通用户性别，1为男性，2为女性",required = false)
    private Integer sex;

    @Column(name = "c_province",nullable=false)
    @ApiModelProperty(name = "province", value = "普通用户个人资料填写的省份",required = false)
    private String province;

    @Column(name = "c_city",nullable=false)
    @ApiModelProperty(name = "city", value = "普通用户个人资料填写的城市",required = false)
    private String city;

    @Column(name = "c_country",nullable=false)
    @ApiModelProperty(name = "country", value = "国家，如中国为CN",required = false)
    private String country;

    @Column(name = "c_headimgurl",nullable=false)
    @ApiModelProperty(name = "headimgurl", value = "用户头像，最后一个数值代表正方形头像大小（有0、46、64、96、132数值可选，0代表640*640正方形头像），用户没有头像时该项为空",required = false)
    private String headimgurl;

    @Column(name = "c_privilege",nullable=false)
    @ApiModelProperty(name = "privilege", value = "用户特权信息，json数组，如微信沃卡用户为（chinaunicom）",required = false)
    private String privilege;

    @Column(name = "c_unionid",nullable=true)
    @ApiModelProperty(name = "unionid", value = "用户统一标识。针对一个微信开放平台帐号下的应用，同一用户的unionid是唯一的。",required = true)
    private String unionid;
    @Version
    @Column(name = "c_revision",nullable=true)
    @ApiModelProperty(name = "revision", value = "乐观锁",required = false)
    private Integer revision;

    @Column(name = "c_created_by",nullable=true)
    @ApiModelProperty(name = "createdBy", value = "创建人",required = false)
    private String createdBy;

    @Column(name = "c_created_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "createdTime", value = "创建时间",required = false)
    private Date createdTime;

    @Column(name = "c_updated_by",nullable=true)
    @ApiModelProperty(name = "updatedBy", value = "更新人",required = false)
    private String updatedBy;

    @Column(name = "c_updated_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "updatedTime", value = "更新时间",required = false)
    private Date updatedTime;

}